package AbstractTransaction

import (
	"SalaryPayment/Model"
	"fmt"
	"log"
)

type AffiliationTransaction interface {
	RecordMembership(employee *Model.Employee)
	GetAffiliation() Model.Affiliation
}

type ChangeAffiliationTransaction struct {
	ChangeEmployeeTransaction
	AffiliationTransaction
}

func (transaction *ChangeAffiliationTransaction) Change(employee *Model.Employee) {
	transaction.RecordMembership(employee)
	af := transaction.GetAffiliation()
	employee.SetAffiliation(af)
}

func (transaction *ChangeAffiliationTransaction) CalculateDeductions(pc Model.Paycheck) {
	err := fmt.Errorf("The method or operation is not implemented.")
	log.Println(err.Error())
}
